<?php

ini_set('display_errors', 1);
error_reporting(-1);
require_once '/data/wwwroot/g_vendor/autoload.php';

$order_no = $argv[1] ?? '';

if (!$order_no) exit('no order');

$order = \Biz\model\trade\Order::get('*', ['order_no' => $order_no]);

$list = [
    [
        'table' => 'order',
        'data' => $order,
    ],
    [
        'table' => 'order_goods',
        'data' => [
            'order_no' => $order_no
        ],
    ],
];


foreach ($list as $v) {
    \Biz\service\esSearch\Order::syncSave($v);
}

